package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        System.out.println(main);
        dosome();
        Thread t = new Thread(){
            @Override
            public void run() {
                System.out.println("你好,新线程");
                System.out.println(Thread.currentThread());
            }
        };
        t.start();

    }

    public static void dosome(){
        Thread t = Thread.currentThread();
        System.out.println(t);
        System.out.println("名字:"+t.getName());
        System.out.println("唯一标识id:"+t.getId());
        System.out.println("存活与否"+t.isAlive());
        System.out.println("优先级:"+t.getPriority());
        System.out.println("是否守护线程:"+t.isDaemon());
    }
}
